home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994 November: Tool Chest / Dev.CD Nov 94.toast / Tool Chest / !Interfaces / Universal Interfaces 2.0a1 / PInterfaces / AppleEvents.p < prev    next >
Encoding:
Text File  |  1994-07-21  |  25.7 KB  |  663 lines  |  [TEXT/MPS ]

  1. {
  2.      File:        AppleEvents.p
  3.  
  4.      Copyright:    © 1984-1994 by Apple Computer, Inc.
  5.                  All rights reserved.
  6.  
  7.      Version:    Universal Interfaces 2.0a1.1  ETO #15, MPW prerelease.  Sunday, July 17, 1994. 
  8.  
  9.      Bugs?:        If you find a problem with this file, send the file and version
  10.                  information (from above) and the problem description to:
  11.  
  12.                      Internet:    apple.bugs@applelink.apple.com
  13.                      AppleLink:    APPLE.BUGS
  14.  
  15. }
  16.  
  17. {$IFC UNDEFINED UsingIncludes}
  18. {$SETC UsingIncludes := 0}
  19. {$ENDC}
  20.  
  21. {$IFC NOT UsingIncludes}
  22.  UNIT AppleEvents;
  23.  INTERFACE
  24. {$ENDC}
  25.  
  26. {$IFC UNDEFINED __APPLEEVENTS__}
  27. {$SETC __APPLEEVENTS__ := 1}
  28.  
  29. {$I+}
  30. {$SETC AppleEventsIncludes := UsingIncludes}
  31. {$SETC UsingIncludes := 1}
  32.  
  33.  
  34. {$IFC UNDEFINED __ERRORS__}
  35. {$I Errors.p}
  36. {$ENDC}
  37. {    ConditionalMacros.p                                            }
  38.  
  39. {$IFC UNDEFINED __TYPES__}
  40. {$I Types.p}
  41. {$ENDC}
  42.  
  43. {$IFC UNDEFINED __MEMORY__}
  44. {$I Memory.p}
  45. {$ENDC}
  46. {    MixedMode.p                                                    }
  47.  
  48. {$IFC UNDEFINED __OSUTILS__}
  49. {$I OSUtils.p}
  50. {$ENDC}
  51.  
  52. {$IFC UNDEFINED __EVENTS__}
  53. {$I Events.p}
  54. {$ENDC}
  55. {    Quickdraw.p                                                    }
  56. {        QuickdrawText.p                                            }
  57.  
  58. {$IFC UNDEFINED __EPPC__}
  59. {$I EPPC.p}
  60. {$ENDC}
  61. {    PPCToolbox.p                                                }
  62. {        AppleTalk.p                                                }
  63. {    Processes.p                                                    }
  64. {        Files.p                                                    }
  65.  
  66. {$IFC UNDEFINED __NOTIFICATION__}
  67. {$I Notification.p}
  68. {$ENDC}
  69.  
  70. {$PUSH}
  71. {$ALIGN MAC68K}
  72. {$LibExport+}
  73.  
  74. CONST
  75. { Apple event descriptor types }
  76.     typeBoolean                    = 'bool';
  77.     typeChar                    = 'TEXT';
  78.     typeSMInt                    = 'shor';
  79.     typeInteger                    = 'long';
  80.     typeSMFloat                    = 'sing';
  81.     typeFloat                    = 'doub';
  82.     typeLongInteger                = 'long';
  83.     typeShortInteger            = 'shor';
  84.     typeLongFloat                = 'doub';
  85.     typeShortFloat                = 'sing';
  86.     typeExtended                = 'exte';
  87.     typeComp                    = 'comp';
  88.     typeMagnitude                = 'magn';
  89.     typeAEList                    = 'list';
  90.     typeAERecord                = 'reco';
  91.     typeAppleEvent                = 'aevt';
  92.     typeTrue                    = 'true';
  93.     typeFalse                    = 'fals';
  94.     typeAlias                    = 'alis';
  95.     typeEnumerated                = 'enum';
  96.     typeType                    = 'type';
  97.     typeAppParameters            = 'appa';
  98.     typeProperty                = 'prop';
  99.     typeFSS                        = 'fss ';
  100.     typeKeyword                    = 'keyw';
  101.     typeSectionH                = 'sect';
  102.     typeWildCard                = '****';
  103.     typeApplSignature            = 'sign';
  104.     typeQDRectangle                = 'qdrt';
  105.     typeFixed                    = 'fixd';
  106.     typeSessionID                = 'ssid';
  107.     typeTargetID                = 'targ';
  108.     typeProcessSerialNumber        = 'psn ';
  109.     typeNull                    = 'null';                        { null or nonexistent data }
  110. { Keywords for Apple event parameters }
  111.     keyDirectObject                = '----';
  112.     keyErrorNumber                = 'errn';
  113.     keyErrorString                = 'errs';
  114.     keyProcessSerialNumber        = 'psn ';
  115. { Keywords for Apple event attributes }
  116.     keyTransactionIDAttr        = 'tran';
  117.     keyReturnIDAttr                = 'rtid';
  118.     keyEventClassAttr            = 'evcl';
  119.     keyEventIDAttr                = 'evid';
  120.     keyAddressAttr                = 'addr';
  121.     keyOptionalKeywordAttr        = 'optk';
  122.     keyTimeoutAttr                = 'timo';
  123.     keyInteractLevelAttr        = 'inte';                        { this attribute is read only - will be set in AESend }
  124.     keyEventSourceAttr            = 'esrc';                        { this attribute is read only }
  125.     keyMissedKeywordAttr        = 'miss';                        { this attribute is read only }
  126.     keyOriginalAddressAttr        = 'from';                        { new in 1.0.1 }
  127. { Keywords for special handlers }
  128.     keyPreDispatch                = 'phac';                        { preHandler accessor call }
  129.     keySelectProc                = 'selh';                        { more selector call }
  130. { Keyword for recording }
  131.     keyAERecorderCount            = 'recr';                        { available only in vers 1.0.1 and greater }
  132. { Keyword for version information }
  133.     keyAEVersion                = 'vers';                        { available only in vers 1.0.1 and greater }
  134. { Event Class }
  135.     kCoreEventClass                = 'aevt';
  136. { Event ID’s }
  137.     kAEOpenApplication            = 'oapp';
  138.     kAEOpenDocuments            = 'odoc';
  139.     kAEPrintDocuments            = 'pdoc';
  140.     kAEQuitApplication            = 'quit';
  141.     kAEAnswer                    = 'ansr';
  142.     kAEApplicationDied            = 'obit';
  143.  
  144. { Constants for use in AESend mode }
  145.     kAENoReply                    = $00000001;                    { sender doesn't want a reply to event }
  146.     kAEQueueReply                = $00000002;                    { sender wants a reply but won't wait }
  147.     kAEWaitReply                = $00000003;                    { sender wants a reply and will wait }
  148.     kAENeverInteract            = $00000010;                    { server should not interact with user }
  149.     kAECanInteract                = $00000020;                    { server may try to interact with user }
  150.     kAEAlwaysInteract            = $00000030;                    { server should always interact with user where appropriate }
  151.     kAECanSwitchLayer            = $00000040;                    { interaction may switch layer }
  152.     kAEDontReconnect            = $00000080;                    { don't reconnect if there is a sessClosedErr from PPCToolbox }
  153.     kAEWantReceipt                = nReturnReceipt;                { sender wants a receipt of message }
  154.     kAEDontRecord                = $00001000;                    { don't record this event - available only in vers 1.0.1 and greater }
  155.     kAEDontExecute                = $00002000;                    { don't send the event for recording - available only in vers 1.0.1 and greater }
  156. { Constants for the send priority in AESend }
  157.     kAENormalPriority            = $00000000;                    { post message at the end of the event queue }
  158.     kAEHighPriority                = nAttnMsg;                        { post message at the front of the event queue }
  159.  
  160. { Constants for recording }
  161.     kAEStartRecording            = 'reca';                        { available only in vers 1.0.1 and greater }
  162.     kAEStopRecording            = 'recc';                        { available only in vers 1.0.1 and greater }
  163.     kAENotifyStartRecording        = 'rec1';                        { available only in vers 1.0.1 and greater }
  164.     kAENotifyStopRecording        = 'rec0';                        { available only in vers 1.0.1 and greater }
  165.     kAENotifyRecording            = 'recr';
  166.  
  167. { Constant for the returnID param of AECreateAppleEvent }
  168.     kAutoGenerateReturnID        = -1;                            { AECreateAppleEvent will generate a session-unique ID }
  169. { Constant for transaction ID’s }
  170.     kAnyTransactionID            = 0;                            { no transaction is in use }
  171. { Constants for timeout durations }
  172.     kAEDefaultTimeout            = -1;                            { timeout value determined by AEM }
  173.     kNoTimeOut                    = -2;                            { wait until reply comes back, however long it takes }
  174.  
  175. { Constants for AEResumeTheCurrentEvent }
  176.     kAENoDispatch                = 0;                            { dispatch parameter to AEResumeTheCurrentEvent takes a pointer to a dispatch }
  177.     kAEUseStandardDispatch        = $FFFFFFFF;                    { table, or one of these two constants }
  178. { Constants for Refcon in AEResumeTheCurrentEvent with kAEUseStandardDispatch }
  179.     kAEDoNotIgnoreHandler        = $00000000;
  180.     kAEIgnoreAppPhacHandler        = $00000001;                    { available only in vers 1.0.1 and greater }
  181.     kAEIgnoreAppEventHandler    = $00000002;                    { available only in vers 1.0.1 and greater }
  182.     kAEIgnoreSysPhacHandler        = $00000004;                    { available only in vers 1.0.1 and greater }
  183.     kAEIgnoreSysEventHandler    = $00000008;                    { available only in vers 1.0.1 and greater }
  184.     kAEIngoreBuiltInEventHandler = $00000010;                    { available only in vers 1.0.1 and greater }
  185.     kAEDontDisposeOnResume        = $80000000;                    { available only in vers 1.0.1 and greater }
  186.  
  187. { Apple event manager data types }
  188.     
  189. TYPE
  190. AEEventClass = FourCharCode;
  191.  
  192.     AEEventID = FourCharCode;
  193.  
  194.     AEKeyword = FourCharCode;
  195.  
  196.     DescType = ResType;
  197.  
  198.     AEDesc = RECORD
  199.         descriptorType:            DescType;
  200.         dataHandle:                Handle;
  201.     END;
  202.     AEKeyDesc = RECORD
  203.         descKey:                AEKeyword;
  204.         descContent:            AEDesc;
  205.     END;
  206. { an AEDesc which contains address data }
  207.     AEAddressDesc = AEDesc;
  208.  
  209. { a list of AEDesc's is a special kind of AEDesc }
  210.     AEDescList = AEDesc;
  211.  
  212. { AERecord is a list of keyworded AEDesc's }
  213.     AERecord = AEDescList;
  214.  
  215. { an AERecord that contains an AppleEvent }
  216.     AppleEvent = AERecord;
  217.  
  218. { parameter to AESend }
  219.     AESendMode = LONGINT;
  220.  
  221. { priority param of AESend }
  222.     AESendPriority = INTEGER;
  223.  
  224.  
  225. CONST
  226.     kAEInteractWithSelf            = 0;
  227.     kAEInteractWithLocal        = 1;
  228.     kAEInteractWithAll            = 2;
  229.  
  230.     
  231. TYPE
  232. AEInteractAllowed = CHAR;
  233.  
  234.  
  235. CONST
  236.     kAEUnknownSource            = 0;
  237.     kAEDirectCall                = 1;
  238.     kAESameProcess                = 2;
  239.     kAELocalProcess                = 3;
  240.     kAERemoteProcess            = 4;
  241.  
  242.     
  243. TYPE
  244. AEEventSource = CHAR;
  245.  
  246.  
  247. CONST
  248.     kAEDataArray                = 0;
  249.     kAEPackedArray                = 1;
  250.     kAEHandleArray                = 2;
  251.     kAEDescArray                = 3;
  252.     kAEKeyDescArray                = 4;
  253.  
  254.     
  255. TYPE
  256. AEArrayType = CHAR;
  257.  
  258.     AEArrayData = RECORD
  259.         CASE INTEGER OF
  260.         0: (
  261.             kAEDataArray:                ARRAY [0..0] OF INTEGER;
  262.            );
  263.         1: (
  264.             kAEPackedArray:                PACKED ARRAY [0..0] OF CHAR;
  265.            );
  266.         2: (
  267.             kAEHandleArray:                ARRAY [0..0] OF Handle;
  268.            );
  269.         3: (
  270.             kAEDescArray:                ARRAY [0..0] OF AEDesc;
  271.            );
  272.         4: (
  273.             kAEKeyDescArray:            ARRAY [0..0] OF AEKeyDesc;
  274.            );
  275.     END;
  276.  
  277.     AEArrayDataPointer = ^AEArrayData;
  278.  
  279.     AEIdleProcPtr = ProcPtr;  { FUNCTION AEIdle(VAR theEvent: EventRecord; VAR sleepTime: LONGINT; VAR mouseRgn: RgnHandle): BOOLEAN; }
  280.     AEIdleUPP = UniversalProcPtr;
  281.  
  282. CONST
  283.     uppAEIdleProcInfo = $00000FD0; { FUNCTION (4 byte param, 4 byte param, 4 byte param): 1 byte result; }
  284.  
  285. FUNCTION NewAEIdleProc(userRoutine: AEIdleProcPtr): AEIdleUPP;
  286.     {$IFC NOT GENERATINGCFM }
  287.     INLINE $2E9F;
  288.     {$ENDC}
  289.  
  290. FUNCTION CallAEIdleProc(VAR theEvent: EventRecord; VAR sleepTime: LONGINT; VAR mouseRgn: RgnHandle; userRoutine: AEIdleUPP): BOOLEAN;
  291.     {$IFC NOT GENERATINGCFM}
  292.     INLINE $205F, $4E90;
  293.     {$ENDC}
  294. TYPE
  295.     AEFilterProcPtr = ProcPtr;  { FUNCTION AEFilter(VAR theEvent: EventRecord; returnID: LONGINT; transactionID: LONGINT; sender: AEAddressDesc): BOOLEAN; }
  296.     AEFilterUPP = UniversalProcPtr;
  297.  
  298. CONST
  299.     uppAEFilterProcInfo = $00003FD0; { FUNCTION (4 byte param, 4 byte param, 4 byte param, 4 byte param): 1 byte result; }
  300.  
  301. FUNCTION NewAEFilterProc(userRoutine: AEFilterProcPtr): AEFilterUPP;
  302.     {$IFC NOT GENERATINGCFM }
  303.     INLINE $2E9F;
  304.     {$ENDC}
  305.  
  306. FUNCTION CallAEFilterProc(VAR theEvent: EventRecord; returnID: LONGINT; transactionID: LONGINT; sender: AEAddressDesc; userRoutine: AEFilterUPP): BOOLEAN;
  307.     {$IFC NOT GENERATINGCFM}
  308.     INLINE $205F, $4E90;
  309.     {$ENDC}
  310. TYPE
  311.     AEEventHandlerProcPtr = ProcPtr;  { FUNCTION AEEventHandler(theAppleEvent: AppleEvent; VAR reply: AppleEvent; handlerRefcon: LONGINT): OSErr; }
  312.     AEEventHandlerUPP = UniversalProcPtr;
  313.  
  314. CONST
  315.     uppAEEventHandlerProcInfo = $00000FE0; { FUNCTION (4 byte param, 4 byte param, 4 byte param): 2 byte result; }
  316.  
  317. FUNCTION NewAEEventHandlerProc(userRoutine: AEEventHandlerProcPtr): AEEventHandlerUPP;
  318.     {$IFC NOT GENERATINGCFM }
  319.     INLINE $2E9F;
  320.     {$ENDC}
  321.  
  322. FUNCTION CallAEEventHandlerProc(theAppleEvent: AppleEvent; VAR reply: AppleEvent; handlerRefcon: LONGINT; userRoutine: AEEventHandlerUPP): OSErr;
  323.     {$IFC NOT GENERATINGCFM}
  324.     INLINE $205F, $4E90;
  325.     {$ENDC}
  326. TYPE
  327.     AECoerceDescProcPtr = ProcPtr;  { FUNCTION AECoerceDesc(fromDesc: AEDesc; toType: DescType; handlerRefcon: LONGINT; VAR toDesc: AEDesc): OSErr; }
  328.     AECoerceDescUPP = UniversalProcPtr;
  329.  
  330. CONST
  331.     uppAECoerceDescProcInfo = $00003FE0; { FUNCTION (4 byte param, 4 byte param, 4 byte param, 4 byte param): 2 byte result; }
  332.  
  333. FUNCTION NewAECoerceDescProc(userRoutine: AECoerceDescProcPtr): AECoerceDescUPP;
  334.     {$IFC NOT GENERATINGCFM }
  335.     INLINE $2E9F;
  336.     {$ENDC}
  337.  
  338. FUNCTION CallAECoerceDescProc(fromDesc: AEDesc; toType: DescType; handlerRefcon: LONGINT; VAR toDesc: AEDesc; userRoutine: AECoerceDescUPP): OSErr;
  339.     {$IFC NOT GENERATINGCFM}
  340.     INLINE $205F, $4E90;
  341.     {$ENDC}
  342. TYPE
  343.     AECoercePtrProcPtr = ProcPtr;  { FUNCTION AECoercePtr(typeCode: DescType; dataPtr: UNIV Ptr; dataSize: Size; toType: DescType; handlerRefcon: LONGINT; VAR result: AEDesc): OSErr; }
  344.     AECoercePtrUPP = UniversalProcPtr;
  345.  
  346. CONST
  347.     uppAECoercePtrProcInfo = $0003FFE0; { FUNCTION (4 byte param, 4 byte param, 4 byte param, 4 byte param, 4 byte param, 4 byte param): 2 byte result; }
  348.  
  349. FUNCTION NewAECoercePtrProc(userRoutine: AECoercePtrProcPtr): AECoercePtrUPP;
  350.     {$IFC NOT GENERATINGCFM }
  351.     INLINE $2E9F;
  352.     {$ENDC}
  353.  
  354. FUNCTION CallAECoercePtrProc(typeCode: DescType; dataPtr: UNIV Ptr; dataSize: Size; toType: DescType; handlerRefcon: LONGINT; VAR result: AEDesc; userRoutine: AECoercePtrUPP): OSErr;
  355.     {$IFC NOT GENERATINGCFM}
  356.     INLINE $205F, $4E90;
  357.     {$ENDC}
  358.     
  359. TYPE
  360. AECoercionHandlerUPP = UniversalProcPtr;
  361.  
  362. {*************************************************************************
  363.  The following calls apply to any AEDesc. Every 'result' descriptor is
  364.  created for you, so you will be responsible for memory management
  365.  (including disposing) of the descriptors so created. Note: purgeable
  366.  descriptor data is not supported - the AEM does not call LoadResource.  
  367. *************************************************************************}
  368.  
  369. FUNCTION AECreateDesc(typeCode: DescType; dataPtr: UNIV Ptr; dataSize: Size; VAR result: AEDesc): OSErr;
  370.     {$IFC NOT GENERATINGCFM}
  371.     INLINE $303C, $0825, $A816;
  372.     {$ENDC}
  373. FUNCTION AECoercePtr(typeCode: DescType; dataPtr: UNIV Ptr; dataSize: Size; toType: DescType; VAR result: AEDesc): OSErr;
  374.     {$IFC NOT GENERATINGCFM}
  375.     INLINE $303C, $0A02, $A816;
  376.     {$ENDC}
  377. FUNCTION AECoerceDesc(theAEDesc: AEDesc; toType: DescType; VAR result: AEDesc): OSErr;
  378.     {$IFC NOT GENERATINGCFM}
  379.     INLINE $303C, $0603, $A816;
  380.     {$ENDC}
  381. FUNCTION AEDisposeDesc(VAR theAEDesc: AEDesc): OSErr;
  382.     {$IFC NOT GENERATINGCFM}
  383.     INLINE $303C, $0204, $A816;
  384.     {$ENDC}
  385. FUNCTION AEDuplicateDesc(theAEDesc: AEDesc; VAR result: AEDesc): OSErr;
  386.     {$IFC NOT GENERATINGCFM}
  387.     INLINE $303C, $0405, $A816;
  388.     {$ENDC}
  389. {*************************************************************************
  390.   The following calls apply to AEDescList. Since AEDescList is a subtype of
  391.   AEDesc, the calls in the previous section can also be used for AEDescList.
  392.   All list and array indices are 1-based. If the data was greater than
  393.   maximumSize in the routines below, then actualSize will be greater than
  394.   maximumSize, but only maximumSize bytes will actually be retrieved.
  395. *************************************************************************}
  396. FUNCTION AECreateList(factoringPtr: UNIV Ptr; factoredSize: Size; isRecord: BOOLEAN; VAR resultList: AEDescList): OSErr;
  397.     {$IFC NOT GENERATINGCFM}
  398.     INLINE $303C, $0706, $A816;
  399.     {$ENDC}
  400. FUNCTION AECountItems(theAEDescList: AEDescList; VAR theCount: LONGINT): OSErr;
  401.     {$IFC NOT GENERATINGCFM}
  402.     INLINE $303C, $0407, $A816;
  403.     {$ENDC}
  404. FUNCTION AEPutPtr(VAR theAEDescList: AEDescList; index: LONGINT; typeCode: DescType; dataPtr: UNIV Ptr; dataSize: Size): OSErr;
  405.     {$IFC NOT GENERATINGCFM}
  406.     INLINE $303C, $0A08, $A816;
  407.     {$ENDC}
  408. FUNCTION AEPutDesc(VAR theAEDescList: AEDescList; index: LONGINT; theAEDesc: AEDesc): OSErr;
  409.     {$IFC NOT GENERATINGCFM}
  410.     INLINE $303C, $0609, $A816;
  411.     {$ENDC}
  412. FUNCTION AEGetNthPtr(theAEDescList: AEDescList; index: LONGINT; desiredType: DescType; VAR theAEKeyword: AEKeyword; VAR typeCode: DescType; dataPtr: UNIV Ptr; maximumSize: Size; VAR actualSize: Size): OSErr;
  413.     {$IFC NOT GENERATINGCFM}
  414.     INLINE $303C, $100A, $A816;
  415.     {$ENDC}
  416. FUNCTION AEGetNthDesc(theAEDescList: AEDescList; index: LONGINT; desiredType: DescType; VAR theAEKeyword: AEKeyword; VAR result: AEDesc): OSErr;
  417.     {$IFC NOT GENERATINGCFM}
  418.     INLINE $303C, $0A0B, $A816;
  419.     {$ENDC}
  420. FUNCTION AESizeOfNthItem(theAEDescList: AEDescList; index: LONGINT; VAR typeCode: DescType; VAR dataSize: Size): OSErr;
  421.     {$IFC NOT GENERATINGCFM}
  422.     INLINE $303C, $082A, $A816;
  423.     {$ENDC}
  424. FUNCTION AEGetArray(theAEDescList: AEDescList; arrayType: ByteParameter; arrayPtr: AEArrayDataPointer; maximumSize: Size; VAR itemType: DescType; VAR itemSize: Size; VAR itemCount: LONGINT): OSErr;
  425.     {$IFC NOT GENERATINGCFM}
  426.     INLINE $303C, $0D0C, $A816;
  427.     {$ENDC}
  428. FUNCTION AEPutArray(VAR theAEDescList: AEDescList; arrayType: ByteParameter; arrayPtr: AEArrayData; itemType: DescType; itemSize: Size; itemCount: LONGINT): OSErr;
  429.     {$IFC NOT GENERATINGCFM}
  430.     INLINE $303C, $0B0D, $A816;
  431.     {$ENDC}
  432. FUNCTION AEDeleteItem(VAR theAEDescList: AEDescList; index: LONGINT): OSErr;
  433.     {$IFC NOT GENERATINGCFM}
  434.     INLINE $303C, $040E, $A816;
  435.     {$ENDC}
  436. {*************************************************************************
  437.  The following calls apply to AERecord. Since AERecord is a subtype of
  438.  AEDescList, the calls in the previous sections can also be used for
  439.  AERecord an AERecord can be created by using AECreateList with isRecord
  440.  set to true. 
  441. *************************************************************************}
  442. FUNCTION AEPutKeyPtr(VAR theAppleEvent: AppleEvent; theAEKeyword: AEKeyword; typeCode: DescType; dataPtr: UNIV Ptr; dataSize: Size): OSErr;
  443.     {$IFC NOT GENERATINGCFM}
  444.     INLINE $303C, $0A0F, $A816;
  445.     {$ENDC}
  446. FUNCTION AEPutKeyDesc(VAR theAppleEvent: AppleEvent; theAEKeyword: AEKeyword; theAEDesc: AEDesc): OSErr;
  447.     {$IFC NOT GENERATINGCFM}
  448.     INLINE $303C, $0610, $A816;
  449.     {$ENDC}
  450. FUNCTION AEGetKeyPtr(theAppleEvent: AppleEvent; theAEKeyword: AEKeyword; desiredType: DescType; VAR typeCode: DescType; dataPtr: UNIV Ptr; maximumSize: Size; VAR actualSize: Size): OSErr;
  451.     {$IFC NOT GENERATINGCFM}
  452.     INLINE $303C, $0E11, $A816;
  453.     {$ENDC}
  454. FUNCTION AEGetKeyDesc(theAppleEvent: AppleEvent; theAEKeyword: AEKeyword; desiredType: DescType; VAR result: AEDesc): OSErr;
  455.     {$IFC NOT GENERATINGCFM}
  456.     INLINE $303C, $0812, $A816;
  457.     {$ENDC}
  458. FUNCTION AESizeOfKeyDesc(theAppleEvent: AppleEvent; theAEKeyword: AEKeyword; VAR typeCode: DescType; VAR dataSize: Size): OSErr;
  459.     {$IFC NOT GENERATINGCFM}
  460.     INLINE $303C, $0829, $A816;
  461.     {$ENDC}
  462. FUNCTION AEDeleteKeyDesc(VAR theAppleEvent: AppleEvent; theAEKeyword: AEKeyword): OSErr;
  463.     {$IFC NOT GENERATINGCFM}
  464.     INLINE $303C, $0413, $A816;
  465.     {$ENDC}
  466. FUNCTION AEPutParamPtr(VAR theAppleEvent: AppleEvent; theAEKeyword: AEKeyword; typeCode: DescType; dataPtr: UNIV Ptr; dataSize: Size): OSErr;
  467.     {$IFC NOT GENERATINGCFM}
  468.     INLINE $303C, $0A0F, $A816;
  469.     {$ENDC}
  470. FUNCTION AEPutParamDesc(VAR theAppleEvent: AppleEvent; theAEKeyword: AEKeyword; theAEDesc: AEDesc): OSErr;
  471.     {$IFC NOT GENERATINGCFM}
  472.     INLINE $303C, $0610, $A816;
  473.     {$ENDC}
  474. FUNCTION AEGetParamPtr(theAppleEvent: AppleEvent; theAEKeyword: AEKeyword; desiredType: DescType; VAR typeCode: DescType; dataPtr: UNIV Ptr; maximumSize: Size; VAR actualSize: Size): OSErr;
  475.     {$IFC NOT GENERATINGCFM}
  476.     INLINE $303C, $0E11, $A816;
  477.     {$ENDC}
  478. FUNCTION AEGetParamDesc(theAppleEvent: AppleEvent; theAEKeyword: AEKeyword; desiredType: DescType; VAR result: AEDesc): OSErr;
  479.     {$IFC NOT GENERATINGCFM}
  480.     INLINE $303C, $0812, $A816;
  481.     {$ENDC}
  482. FUNCTION AESizeOfParam(theAppleEvent: AppleEvent; theAEKeyword: AEKeyword; VAR typeCode: DescType; VAR dataSize: Size): OSErr;
  483.     {$IFC NOT GENERATINGCFM}
  484.     INLINE $303C, $0829, $A816;
  485.     {$ENDC}
  486. FUNCTION AEDeleteParam(VAR theAppleEvent: AppleEvent; theAEKeyword: AEKeyword): OSErr;
  487.     {$IFC NOT GENERATINGCFM}
  488.     INLINE $303C, $0413, $A816;
  489.     {$ENDC}
  490. {*************************************************************************
  491.  The following calls also apply to type AppleEvent. Message attributes are
  492.  far more restricted, and can only be accessed through the following 5
  493.  calls. The various list and record routines cannot be used to access the
  494.  attributes of an event. 
  495. *************************************************************************}
  496. FUNCTION AEGetAttributePtr(theAppleEvent: AppleEvent; theAEKeyword: AEKeyword; desiredType: DescType; VAR typeCode: DescType; dataPtr: UNIV Ptr; maximumSize: Size; VAR actualSize: Size): OSErr;
  497.     {$IFC NOT GENERATINGCFM}
  498.     INLINE $303C, $0E15, $A816;
  499.     {$ENDC}
  500. FUNCTION AEGetAttributeDesc(theAppleEvent: AppleEvent; theAEKeyword: AEKeyword; desiredType: DescType; VAR result: AEDesc): OSErr;
  501.     {$IFC NOT GENERATINGCFM}
  502.     INLINE $303C, $0826, $A816;
  503.     {$ENDC}
  504. FUNCTION AESizeOfAttribute(theAppleEvent: AppleEvent; theAEKeyword: AEKeyword; VAR typeCode: DescType; VAR dataSize: Size): OSErr;
  505.     {$IFC NOT GENERATINGCFM}
  506.     INLINE $303C, $0828, $A816;
  507.     {$ENDC}
  508. FUNCTION AEPutAttributePtr(VAR theAppleEvent: AppleEvent; theAEKeyword: AEKeyword; typeCode: DescType; dataPtr: UNIV Ptr; dataSize: Size): OSErr;
  509.     {$IFC NOT GENERATINGCFM}
  510.     INLINE $303C, $0A16, $A816;
  511.     {$ENDC}
  512. FUNCTION AEPutAttributeDesc(VAR theAppleEvent: AppleEvent; theAEKeyword: AEKeyword; theAEDesc: AEDesc): OSErr;
  513.     {$IFC NOT GENERATINGCFM}
  514.     INLINE $303C, $0627, $A816;
  515.     {$ENDC}
  516. {*************************************************************************
  517.   The next couple of calls are basic routines used to create, send,
  518.   and process AppleEvents. 
  519. *************************************************************************}
  520. FUNCTION AECreateAppleEvent(theAEEventClass: AEEventClass; theAEEventID: AEEventID; target: AEAddressDesc; returnID: INTEGER; transactionID: LONGINT; VAR result: AppleEvent): OSErr;
  521.     {$IFC NOT GENERATINGCFM}
  522.     INLINE $303C, $0B14, $A816;
  523.     {$ENDC}
  524. FUNCTION AESend(theAppleEvent: AppleEvent; VAR reply: AppleEvent; sendMode: AESendMode; sendPriority: AESendPriority; timeOutInTicks: LONGINT; idleProc: AEIdleUPP; filterProc: AEFilterUPP): OSErr;
  525.     {$IFC NOT GENERATINGCFM}
  526.     INLINE $303C, $0D17, $A816;
  527.     {$ENDC}
  528. FUNCTION AEProcessAppleEvent(theEventRecord: EventRecord): OSErr;
  529.     {$IFC NOT GENERATINGCFM}
  530.     INLINE $303C, $021B, $A816;
  531.     {$ENDC}
  532.  Note: during event processing, an event handler may realize that it is likely
  533.  to exceed the client's timeout limit. Passing the reply to this
  534.  routine causes a wait event to be generated that asks the client
  535.  for more time. 
  536. }
  537. FUNCTION AEResetTimer(reply: AppleEvent): OSErr;
  538.     {$IFC NOT GENERATINGCFM}
  539.     INLINE $303C, $0219, $A816;
  540.     {$ENDC}
  541. {*************************************************************************
  542.  The following four calls are available for applications which need more
  543.  sophisticated control over when and how events are processed. Applications
  544.  which implement multi-session servers or which implement their own
  545.  internal event queueing will probably be the major clients of these
  546.  routines. They can be called from within a handler to prevent the AEM from
  547.  disposing of the AppleEvent when the handler returns. They can be used to
  548.  asynchronously process the event (as MacApp does).
  549. *************************************************************************}
  550. FUNCTION AESuspendTheCurrentEvent(theAppleEvent: AppleEvent): OSErr;
  551.     {$IFC NOT GENERATINGCFM}
  552.     INLINE $303C, $022B, $A816;
  553.     {$ENDC}
  554.  Note: The following routine tells the AppleEvent manager that processing
  555.  is either about to resume or has been completed on a previously suspended
  556.  event. The procPtr passed in as the dispatcher parameter will be called to
  557.  attempt to redispatch the event. Several constants for the dispatcher
  558.  parameter allow special behavior. They are:
  559.       - kAEUseStandardDispatch means redispatch as if the event was just
  560.       received, using the standard AppleEvent dispatch mechanism.
  561.       - kAENoDispatch means ignore the parameter.
  562.          Use this in the case where the event has been handled and no
  563.       redispatch is needed.
  564.       - non nil means call the routine which the dispatcher points to.
  565. }
  566. FUNCTION AEResumeTheCurrentEvent(theAppleEvent: AppleEvent; reply: AppleEvent; dispatcher: AEEventHandlerUPP; handlerRefcon: LONGINT): OSErr;
  567.     {$IFC NOT GENERATINGCFM}
  568.     INLINE $303C, $0818, $A816;
  569.     {$ENDC}
  570. FUNCTION AEGetTheCurrentEvent(VAR theAppleEvent: AppleEvent): OSErr;
  571.     {$IFC NOT GENERATINGCFM}
  572.     INLINE $303C, $021A, $A816;
  573.     {$ENDC}
  574. FUNCTION AESetTheCurrentEvent(theAppleEvent: AppleEvent): OSErr;
  575.     {$IFC NOT GENERATINGCFM}
  576.     INLINE $303C, $022C, $A816;
  577.     {$ENDC}
  578. {*************************************************************************
  579.   The following three calls are used to allow applications to behave
  580.   courteously when a user interaction such as a dialog box is needed. 
  581. *************************************************************************}
  582. FUNCTION AEGetInteractionAllowed(VAR level: AEInteractAllowed): OSErr;
  583.     {$IFC NOT GENERATINGCFM}
  584.     INLINE $303C, $021D, $A816;
  585.     {$ENDC}
  586. FUNCTION AESetInteractionAllowed(level: ByteParameter): OSErr;
  587.     {$IFC NOT GENERATINGCFM}
  588.     INLINE $303C, $011E, $A816;
  589.     {$ENDC}
  590. FUNCTION AEInteractWithUser(timeOutInTicks: LONGINT; nmReqPtr: NMRecPtr; idleProc: AEIdleUPP): OSErr;
  591.     {$IFC NOT GENERATINGCFM}
  592.     INLINE $303C, $061C, $A816;
  593.     {$ENDC}
  594. {*************************************************************************
  595.   These calls are used to set up and modify the event dispatch table.
  596. *************************************************************************}
  597. FUNCTION AEInstallEventHandler(theAEEventClass: AEEventClass; theAEEventID: AEEventID; handler: AEEventHandlerUPP; handlerRefcon: LONGINT; isSysHandler: BOOLEAN): OSErr;
  598.     {$IFC NOT GENERATINGCFM}
  599.     INLINE $303C, $091F, $A816;
  600.     {$ENDC}
  601. FUNCTION AERemoveEventHandler(theAEEventClass: AEEventClass; theAEEventID: AEEventID; handler: AEEventHandlerUPP; isSysHandler: BOOLEAN): OSErr;
  602.     {$IFC NOT GENERATINGCFM}
  603.     INLINE $303C, $0720, $A816;
  604.     {$ENDC}
  605. FUNCTION AEGetEventHandler(theAEEventClass: AEEventClass; theAEEventID: AEEventID; VAR handler: AEEventHandlerUPP; VAR handlerRefcon: LONGINT; isSysHandler: BOOLEAN): OSErr;
  606.     {$IFC NOT GENERATINGCFM}
  607.     INLINE $303C, $0921, $A816;
  608.     {$ENDC}
  609. {*************************************************************************
  610.   These calls are used to set up and modify the coercion dispatch table.
  611. *************************************************************************}
  612. FUNCTION AEInstallCoercionHandler(fromType: DescType; toType: DescType; handler: AECoercionHandlerUPP; handlerRefcon: LONGINT; fromTypeIsDesc: BOOLEAN; isSysHandler: BOOLEAN): OSErr;
  613.     {$IFC NOT GENERATINGCFM}
  614.     INLINE $303C, $0A22, $A816;
  615.     {$ENDC}
  616. FUNCTION AERemoveCoercionHandler(fromType: DescType; toType: DescType; handler: AECoercionHandlerUPP; isSysHandler: BOOLEAN): OSErr;
  617.     {$IFC NOT GENERATINGCFM}
  618.     INLINE $303C, $0723, $A816;
  619.     {$ENDC}
  620. FUNCTION AEGetCoercionHandler(fromType: DescType; toType: DescType; VAR handler: AECoercionHandlerUPP; VAR handlerRefcon: LONGINT; VAR fromTypeIsDesc: BOOLEAN; isSysHandler: BOOLEAN): OSErr;
  621.     {$IFC NOT GENERATINGCFM}
  622.     INLINE $303C, $0B24, $A816;
  623.     {$ENDC}
  624. {*************************************************************************
  625.   These calls are used to set up and modify special hooks into the
  626.   AppleEvent manager.
  627. *************************************************************************}
  628. FUNCTION AEInstallSpecialHandler(functionClass: AEKeyword; handler: UniversalProcPtr; isSysHandler: BOOLEAN): OSErr;
  629.     {$IFC NOT GENERATINGCFM}
  630.     INLINE $303C, $0500, $A816;
  631.     {$ENDC}
  632. FUNCTION AERemoveSpecialHandler(functionClass: AEKeyword; handler: UniversalProcPtr; isSysHandler: BOOLEAN): OSErr;
  633.     {$IFC NOT GENERATINGCFM}
  634.     INLINE $303C, $0501, $A816;
  635.     {$ENDC}
  636. FUNCTION AEGetSpecialHandler(functionClass: AEKeyword; VAR handler: UniversalProcPtr; isSysHandler: BOOLEAN): OSErr;
  637.     {$IFC NOT GENERATINGCFM}
  638.     INLINE $303C, $052D, $A816;
  639.     {$ENDC}
  640. {*************************************************************************
  641.   This call was added in version 1.0.1. If called with the keyword
  642.   keyAERecorderCount ('recr'), the number of recorders that are
  643.   currently active is returned in 'result'.
  644. *************************************************************************}
  645. { available only in vers 1.0.1 and greater }
  646. FUNCTION AEManagerInfo(keyWord: AEKeyword; VAR result: LONGINT): OSErr;
  647.     {$IFC NOT GENERATINGCFM}
  648.     INLINE $303C, $0441, $A816;
  649.     {$ENDC}
  650.  
  651. {$ALIGN RESET}
  652. {$POP}
  653.  
  654. {$SETC UsingIncludes := AppleEventsIncludes}
  655.  
  656. {$ENDC} {__APPLEEVENTS__}
  657.  
  658. {$IFC NOT UsingIncludes}
  659.  END.
  660. {$ENDC}
  661.